var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/businessComponent/Attachment/views/formAttachment/components/AttachmentToolbar/index.tsx
var AttachmentToolbar_exports = {};
__export(AttachmentToolbar_exports, {
  AttachmentToolbar: () => AttachmentToolbar
});
module.exports = __toCommonJS(AttachmentToolbar_exports);
var import_icons = require("@ant-design/icons");
var import_antd = require("antd");
var import_components = require("../../../../components");
function AttachmentToolbar(props) {
  const {
    permission,
    disabled,
    isReady = true,
    simpleUpload,
    count,
    uploading = false,
    zipDownload,
    openAttachment,
    uploadRef,
    ...rest
  } = props;
  return /* @__PURE__ */ React.createElement(import_antd.Space, { size: [15, 10], wrap: true }, /* @__PURE__ */ React.createElement(import_components.Upload, { ...rest, ref: uploadRef }, /* @__PURE__ */ React.createElement(
    import_components.AttachmentButton,
    {
      permissionStatus: permission == null ? void 0 : permission.add,
      disabled: disabled || !isReady || uploading,
      loading: uploading,
      icon: /* @__PURE__ */ React.createElement(import_icons.UploadOutlined, null)
    },
    "上传文件"
  )), !simpleUpload && /* @__PURE__ */ React.createElement(
    import_components.AttachmentButton,
    {
      disabled: !isReady,
      permissionStatus: permission == null ? void 0 : permission.zipDownload,
      icon: /* @__PURE__ */ React.createElement(import_icons.DownloadOutlined, null),
      onClick: zipDownload
    },
    "打包下载"
  ), !simpleUpload && /* @__PURE__ */ React.createElement(
    import_components.AttachmentButton,
    {
      disabled: !isReady,
      permissionStatus: permission == null ? void 0 : permission.manage,
      icon: /* @__PURE__ */ React.createElement(import_icons.PaperClipOutlined, null),
      onClick: openAttachment
    },
    "附件管理",
    count > 0 ? ` (${count})` : ""
  ));
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  AttachmentToolbar
});
